import { createApp } from 'vue'

import App from './App.vue'
import router from './router'
import installElementPlus from './plugins/element'
import '@/assets/css/global.css'
import axios from "axios"
import { ElMessage,ElMessageBox } from 'element-plus'
import TreeTable from 'vue-table-with-tree-grid'


import image from "@/components/image.vue"

axios.interceptors.request.use(config => {
    // console.log(config)
    // console.log(window.sessionStorage.getItem("token"))
    config.headers.Authorization = window.sessionStorage.getItem("token");
    return config
    
})

const app = createApp(App)
installElementPlus(app)
app.use(router).mount('#app');

app.component('my-image',image);
app.component('tree-table',TreeTable);
axios.defaults.baseURL="http://127.0.0.1:8888/api/private/v1/"
app.config.globalProperties.$http=axios;
app.config.globalProperties.$message=ElMessage;
app.config.globalProperties.$confirm=ElMessageBox.confirm;

